package com.lds.register.center.server.business.appinstance.converter;

import com.lds.register.center.common.model.appinstance.request.AppInstanceBaseGetByKeyRequest;
import com.lds.register.center.server.business.appinstance.entity.AppInstance;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class AppInstanceBaseGetByKeyRequestToEntityConverter implements Converter<AppInstanceBaseGetByKeyRequest, AppInstance> {

    @Override
    public AppInstance convert(AppInstanceBaseGetByKeyRequest source) {
        return AppInstance.builder()
                .ip(source.getIp())
                .port(source.getPort())
                .appId(source.getAppId())
                .build();
    }

}